package com.coocaa.internship.controller;

import com.coocaa.internship.common.ResultData;
import com.coocaa.internship.service.serviceImpl.UserCvServiceImpl;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

/**
 * @Description:
 * @Author: zwh
 * @Date: 2019-07-28
 * @Time: 22:24
 */
@Controller
@RequestMapping("/userCv")
public class UserCvController {
    @Autowired
    UserCvServiceImpl userCvService;

    @GetMapping("/selectUserCv")
    @ResponseBody
    public ResultData selectUserCvByUserId(@RequestParam("userId") Long userId) {
        return userCvService.selectUserCvByUserId(userId);
    }

    @GetMapping("/deleteUserCv")
    @ResponseBody
    public ResultData deleteUserCvByUserCvId(@RequestParam("userCvId") Long userCvId) {
        return userCvService.deleteUserCvById(userCvId);
    }

    @PostMapping("/insertUserCv")
    @ResponseBody
    public ResultData insertUserCvByUserId(@RequestParam(value = "userId") Long userId, @Param("file") MultipartFile file) {
        return userCvService.insertUserCvByUserId(userId, file);
    }
}
